package com.wjbgn.bsolver.server.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

/**
 * Description:
 * Create Date: 2022-04-21T13:26:52.898
 *
 * @author wjbgn
 * @version 1.0
 */
@Data
@Document(indexName = "bsolver_bug_answered_record", shards = 3, replicas = 1)
public class BugAnsweredRecordDO {

    @Id
    @Field(type = FieldType.Keyword)
    private String id;

    @Field(type = FieldType.Keyword)
    private String bugId;

    @Field(type = FieldType.Keyword)
    private String username;

    @Field(type = FieldType.Text)
    private String content;

    @Field(type = FieldType.Keyword)
    private String beAnsweredUsername;

    @Field(type = FieldType.Date, format = DateFormat.basic_date_time)
    private LocalDateTime createTime;

    @Field(type = FieldType.Date, format = DateFormat.basic_date_time)
    private LocalDateTime updateTime;

    @Field(type = FieldType.Keyword)
    private Integer isDelete;

    @Field(type = FieldType.Long)
    private Long acceptNum;

    @Field(type = FieldType.Long)
    private long rejectNum;

    private boolean currentHasAccept;

    private boolean currentHasReject;

    public BugAnsweredRecordDO(String bugId) {
        this.bugId = bugId;
    }

    public BugAnsweredRecordDO() {
    }
}
